package com.guardchina.framework.mybatis;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 描述：mybatis plus配置
 *
 * @author lwb
 * @date 2019/3/25 16:15
 */
@Configuration
public class MybatisPlusConfiguration {

    /**
     * 定义mybatis plus分页插件
     * @return mybatis plus 分页插件
     */
    @Bean
    @ConditionalOnMissingBean(PaginationInterceptor.class)
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }
}
